package com.dogegg.lbbopenapi.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dogegg.lbbopenapi.OpenapiRegisteredClient;
import com.dogegg.lbbopenapi.aspect.OpenApi;
import com.dogegg.lbbopenapi.request.GetUserInfoFromPhoneRequest;



@RestController
@OpenApi("userinfo")
@RequestMapping( { "/open-api/userinfo/" })
public class OpenUserInfoController {

    private static final Logger logger = LoggerFactory.getLogger(OpenUserInfoController.class);

    @PostMapping(value = "/getbyphone")
    public  ResponseEntity<String> getbyphone(@RequestBody GetUserInfoFromPhoneRequest request) {
        String phone = request.getPhone();
        //TODO: 根据手机号查询用户信息
        OpenapiRegisteredClient client = request.getClient(); 
        //返回用户信息可以加密
        return ResponseEntity.ok("success");
    }

   
    

}
